From: Konrad Rzeszutek Wilk Date: Thu, 19 Mar 2015 00:24:18 +0000 (-0400) Subject: libxl: Don't assign return value to errno for E820 get/set xc_ calls X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3548 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=47865edc7f93b476227ce5b17a7850f11df705f2;p=xen.git libxl: Don't assign return value to errno for E820 get/set xc_ calls We should be using the errno that the hypercall left instead of overwriting it with the return value. Signed-off-by: Konrad Rzeszutek Wilk Acked-by: Ian Campbell --- diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c index fd45ead2d6..376b477af7 100644 --- a/tools/libxl/libxl_x86.c +++ b/tools/libxl/libxl_x86.c @@ -215,10 +215,8 @@ static int e820_host_sanitize(libxl__gc *gc, int rc; rc = xc_get_machine_memory_map(CTX->xch, map, *nr); - if (rc < 0) { - errno = rc; + if (rc < 0) return ERROR_FAIL; - } *nr = rc; @@ -251,10 +249,9 @@ static int libxl__e820_alloc(libxl__gc *gc, uint32_t domid, rc = xc_domain_set_memory_map(ctx->xch, domid, map, nr); - if (rc < 0) { - errno = rc; + if (rc < 0) return ERROR_FAIL; - } + return 0; }